package 
{
	import net.flashpunk.Entity;
	import net.flashpunk.graphics.Image;
	
	/**
	 * ...
	 * @author Guido
	 */
	public class Board extends Entity {
		protected var matrix : SudokuMatrix;
		
		private var board : Board;
		[Embed(source = 'assets/board.png')]
		private const BOARD : Class;
		private var boardImage : Image;
		
		public function Board() {
			matrix = new SudokuMatrix;
			boardImage = new Image(BOARD);
			graphic = boardImage;
			SudokuDemonstration.world.add(this);
			for (var row : int = 1; row < 10; row++) {
				for (var col : int = 1; col < 10; col++) {
					var block : Block = new Block(
						Const.LINE_WIDTH + (row - 1) * (Const.BLOCK_WIDTH + Const.LINE_WIDTH -1)
						, Const.LINE_WIDTH + (col - 1) * (Const.BLOCK_HEIGHT));
					matrix.put(row, 1, block);
				}
				
			}
		}
		
		public function getBlock(row : int, column : int) : Block {
			return matrix.get(row, column);
		}
		
		public function compareToBoard(board : Board) : Boolean {
			return (this.matrix.compareToMatrix(board.matrix));
			//TODO
			//Chequear que board distinto de null
		}
		
	}
	
}